<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <!-- 主表单区域 -->
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="6" >
            <a-form-model-item label="时间" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }" prop="date">
              <g-year-picker
                placeholder="请选择时间"
                v-model="model.date"
              ></g-year-picker>
            </a-form-model-item>
          </a-col>
          <a-col :span="8" >
            <a-form-model-item label="荣誉名称" :labelCol="{ span: 12 }" :wrapperCol="{ span: 12 }" prop="projectName">
              <a-input v-model="model.projectName" placeholder="请输入荣誉名称" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8" >
            <a-form-model-item label="总分" :labelCol="{ span: 12 }" :wrapperCol="{ span: 12 }" prop="totalScore">
              <a-input-number :min="0" v-model="model.totalScore" placeholder="请输入总分" style="width: 100%" />
            </a-form-model-item>

          </a-col>
        </a-row>
        <a-row>
          <a-col :span="8">
            <a-form-model-item label="教师" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teacherId">
              <j-select-user-by-dep  v-model="model.teacherId" @change="(...args)=>{selectedUser(...args)}" :multi="false"></j-select-user-by-dep>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="教工编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input placeholder="教工编号" v-model="model.teacherId" :disabled="true"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="积分学院" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgId_dictText">
              <teaching-depart v-model="model.orgId"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="备注" :labelCol="{ span: 2 }" :wrapperCol="{ span: 22 }" prop="remark">
              <a-input v-model="model.remark" placeholder="请输入备注"/>

            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- 子表单区域 -->
  </a-spin>
</template>

<script>

  import {GfxyOneToOneMixin} from '@/mixins/GfxyOneToOneMixin'
  import GYearPicker from '@views/gfxy/common/GYearPicker'
  import TeachingDepart from '@comp/gfxy/TeachingDepart.vue'
  export default {
    name: 'DxryForm',
    mixins: [GfxyOneToOneMixin],
    components: {
      GYearPicker,TeachingDepart
    },
    data() {
      return {

        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        labelCol2: {
          xs: { span: 24 },
          sm: { span: 3 },
        },
        wrapperCol2: {
          xs: { span: 24 },
          sm: { span: 20 },
        },

        // 新增时子表默认添加几行空数据
        validatorRules: {
          date: [
            { required: true, message: '请输入时间!'},
          ],

          projectName: [
            { required: true, message: '请输入名称!'},
          ],
          totalScore:[
            { required: true, message: '请输入分数!'}
          ],
          teacherId: [
            { required: true, message: '请选择教师!'},
          ],
        },
        url: {
          add: "/honour/dxry/add",
          edit: "/honour/dxry/edit",
          queryById: "/honour/dxry/queryById",
          memberList: {
            list: '/honour/dxry/queryMemberListByMainId'
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      },
      itemValue:{
        type: Number,
        required: true,
      },
      date:{
        type: String,
        required: true,
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
      // this.queryParam.date = Vue.ls.get(CURRENT_DATE);
    },
    methods: {


    }
  }
</script>

<style scoped>
</style>